import request from '@/utils/request'
import qs from 'qs'

export function login(data) {
  data.account = data.username
  data = qs.stringify(data)
  return request({
    url: '/csn/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  // token='admin-token'
  var accessToken = token
  return request({
    url: '/csn/user/info',
    method: 'get',
    params: { accessToken }
  })
}

export function logout() {
  return request({
    url: '/csn/user/logout',
    method: 'post'
  })
}
